﻿using System;
using Un4seen.Bass;

namespace Theta.Audio
{
    public class AudioPlugin : IDisposable
    {
        public string DllName;
        public int Handle;
        public bool IsLoaded
        {
            get { return Handle > 0; }
        }

        public AudioPlugin(string dllName)
        {
            DllName = dllName;
        }

        public bool Load()
        {
            Handle = Bass.BASS_PluginLoad(DllName);
            return Handle != 0;
        }

        public void Dispose()
        {
            if(IsLoaded)
                Bass.BASS_PluginFree(Handle);
        }
    }
}
